<?php
	header('Content-Type: text/html; charset=ISO-8859-1');
	require '../config.php';	
	$_codigo = $_REQUEST['id'];
	
		$registros=mysql_query("select * from  clientes where idclientes='".$_codigo."'") or die("Problemas en el select:".mysql_error());
		if (mysql_num_rows($registros) == 0)
		{
			echo "0";
		}
		else
		{	
			$data = array();
			while ($row = mysql_fetch_array($registros)) {
				
			    $data[] = $row['idclientes'];
    			$data[] = $row['nombres'];    			
    			$data[] = $row['apellidos'];    			
    			$data[] = $row['telefono'];    			
    			$data[] = $row['telefono_movil'];    		
    			$data[] = $row['cedula'];    			
    			$data[] = $row['email'];
    			$data[] = $row['fecha_nacimiento'];		 
    			$data[] = $row['provincia'];
  			 
    			$data[] = $row['categoria']; 
    			   			 
    			$data[] = $row['tv'];
    			$data[] = $row['radio'];    			
    			$data[] = $row['iglesia']; 
    			   			 
    			$data[] = $row['direccion'];
    			$data[] = $row['activo'];
    			$data[] = $row['profesion'];
    			$data[] = $row['idruta'];
			}
			
			echo json_encode($data);
		}
			
	
	function _convert($content) {
		if(!mb_check_encoding($content, 'UTF-8')
		OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) {
	
			$content = mb_convert_encoding($content, 'UTF-8');
	
			if (mb_check_encoding($content, 'UTF-8')) {
				// log('Converted to UTF-8');
			} else {
				// log('Could not converted to UTF-8');
			}
		}
		return $content;
	}
?>
